Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(introspection) - Improve schema minification by removing meta types #1351

Merged
merged 3 commits into from
Jan 29, 2021

Conversation

kitten
Copy link
Member

@kitten kitten commented Jan 29, 2021

Summary

This removes more superfluous information from the minified schema introspection JSON data that minifyIntrospectionQuery generates. This has been checked to still be correctly parsed by buildClientSchema.

Set of changes

  • Remove metatypes from schema (See eb7abeb)
  • Remove additional JSON fields from arguments

Specific fields contain meta-information about the schema that
won't need to be included for `buildClientSchema(schema)` to
create a valid schema for the given introspection information,
specifically:

  - __Directive
  - __DirectiveLocation
  - __EnumValue
  - __InputValue
  - __Field
  - __Type
  - __TypeKind
  - __Schema
Instead of spreading arguments we can passthrough their
name and drop the defaultValue field manually. This prevents
fields like `description` and deprecation information from
sticking around.
@changeset-bot
Copy link

changeset-bot bot commented Jan 29, 2021

🦋 Changeset detected

Latest commit: ffba40a

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@urql/introspection Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@kitten kitten requested a review from JoviDeCroock January 29, 2021 18:24
@kitten kitten merged commit c38c721 into main Jan 29, 2021
@kitten kitten deleted the feat/improve-minify-schema branch January 29, 2021 18:28
@github-actions github-actions bot mentioned this pull request Jan 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants